home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wgdb-42.lha / wgdb-4.2 / gdb / vx-share / vxWorks.h < prev    next >
C/C++ Source or Header  |  1992-09-11  |  5KB  |  178 lines

  1. /* vxWorks.h - VxWorks standard definitions header */
  2.  
  3. /* Copyright 1984-1990 Wind River Systems, Inc. */
  4.  
  5. /*
  6. modification history
  7. --------------------
  8. 01z,05oct90,shl  added copyright notice.
  9.                  made #endif ANSI style.
  10. 01y,28sep90,del  added I960 defines.
  11. 01x,29may90,del     moved types to vxTypes.h
  12. 01w,09apr90,jcf  added timeout definitions.
  13. 01v,24jan90,gae  moved network configuration flags here from makefile's.
  14. 01u,01sep88,mcl  definition of INSTR dependent on processor family; added SPARC.
  15.        +gae  added MC680X0 and defined CPU_FAMILY.
  16. 01t,08apr89,dnw  added ifdef to prevent inclusion of vxWorks.h more than once.
  17. 01s,22jun88,dnw     moved READ, WRITE, and UPDATE back here from ioLib.h.
  18. 01r,22apr88,gae  oops! forgot some #endif's in 01q.
  19. 01q,12apr88,gae  removed QUICK & WAIT; added STD_{IN,OUT,ERR}.
  20.          fixed #define's of FALSE, TRUE, etc.
  21.          moved READ, WRITE, and UPDATE to ioLib.h.
  22. 01p,04dec87,dnw  added undefine of MC68000 to get around Green Hills bug that
  23.            pre-defines MC68000.
  24. 01o,12nov87,ecs  added type ULONG.
  25. 01n,08feb86,dnw  added types INSTR, UINT, USHORT.
  26. 01m,14oct85,rdc  added BUS types.
  27. 01l,16jul85,jlf  added conditional for NULL and EOF.
  28. 01k,24jun85,rdc  installed condtional compile so we can include in
  29.          assembly language files.  See instructions below.
  30.          Added System type macro and CPU type macro.
  31. 01j,13jun85,dnw  cleaned-up, removed more obsolete stuff to wrs.h
  32. 01i,11sep84,jlf  changed name from wrs.h to vxWorks.h.  removed GLOBAL.
  33. 01h,03jun84,dnw  removed IGNORE declaration.
  34. 01g,09apr84,jlf  added MEMBER_SIZE macro.
  35. 01f,14dec83,dnw  added MSB, LSB macros
  36. 01e,17nov83,jlf  added STATUS type, for routines which return a status.
  37. 01d,13jul83,dnw  added NELEMENTS macro
  38. 01c,14May83,dnw  added OFFSET macro
  39. 01b,17Feb83,dnw  added stuff from Whitesmiths std.h
  40. 01a,15Feb83,dnw  written
  41. */
  42.  
  43. #ifndef INCvxWorksh
  44. #define INCvxWorksh
  45.  
  46. #if    !defined(NULL) || (NULL!=0)
  47. #define NULL        0
  48. #endif    
  49.  
  50. #if    !defined(EOF) || (EOF!=(-1))
  51. #define EOF        (-1)
  52. #endif    
  53.  
  54. #if    !defined(FALSE) || (FALSE!=0)
  55. #define FALSE        0
  56. #endif    
  57.  
  58. #if    !defined(TRUE) || (TRUE!=1)
  59. #define TRUE        1
  60. #endif    
  61.  
  62.  
  63. #define NONE        (-1)    /* for times when NULL won't do */
  64. #define EOS        '\0'    /* C string terminator */
  65.  
  66.  
  67. /* return status values */
  68.  
  69. #define OK        0
  70. #define ERROR        (-1)
  71.  
  72. /* timeout defines */
  73.  
  74. #define NO_WAIT        0
  75. #define WAIT_FOREVER    (-1)
  76.  
  77. /* low-level I/O input, output, error fd's */
  78.  
  79. #define    STD_IN    0
  80. #define    STD_OUT    1
  81. #define    STD_ERR    2
  82.  
  83. /* modes - must match O_RDONLY/O_WRONLY/O_RDWR in ioLib.h! */
  84.  
  85. #define READ        0
  86. #define WRITE        1
  87. #define UPDATE        2
  88.  
  89. /* SYSTEM types */
  90.  
  91. #define V7        1    /* ATT version 7 */
  92. #define SYS_V        2    /* ATT System 5 */
  93. #define BSD_4_2        3    /* Berkeley BSD 4.2 */
  94.  
  95. /* CPU types */
  96.  
  97. /* The Green Hills compiler pre-defines "MC68000"!! */
  98. #ifdef MC68000
  99. #undef MC68000
  100. #endif    
  101.  
  102. #define MC68000        1
  103. #define MC68010        2
  104. #define MC68020        3
  105. #define MC68030        4
  106. #define MC68040        5
  107. #define MC680X0        9
  108.  
  109. #define SPARC        10
  110.  
  111. #ifndef I960
  112. #define    I960        20
  113. #endif    
  114.  
  115. #define    I960KB        21
  116. #define    I960CA        22
  117.  
  118. #if    CPU==MC68000 || CPU==MC68010 || CPU==MC68020 || CPU==MC68030
  119. #define    CPU_FAMILY    MC680X0
  120. #endif    /* CPU==MC68000 || CPU==MC68010 || CPU==MC68020 || CPU==MC68030 */
  121.  
  122. #if    CPU==SPARC
  123. #define    CPU_FAMILY    SPARC
  124. #endif    /* CPU==SPARC */
  125.  
  126. #if     CPU==I960KB
  127. #define    CPU_FAMILY    I960
  128. #endif    /*     CPU==I960KB */
  129.  
  130. #if     CPU==I960CA
  131. #define    CPU_FAMILY    I960
  132. #endif    /*     CPU==I960CA */
  133.  
  134. /* BUS types */
  135.  
  136. #define VME_BUS        1
  137. #define MULTI_BUS    2
  138.  
  139. /* network configuration parameters */
  140.  
  141. #define    INET        /* include internet protocols */
  142. #define    BSD    43    /* BSD 4.3 -like OS */
  143. #define    BSDDEBUG    /* turn on debug */
  144. #define    GATEWAY        /* tables to be initialized for gateway routing */
  145.  
  146. /* common macros */
  147.  
  148. #define MSB(x)    (((x) >> 8) & 0xff)    /* most signif byte of 2-byte integer */
  149. #define LSB(x)    ((x) & 0xff)        /* least signif byte of 2-byte integer*/
  150.  
  151. #define OFFSET(structure, member)    /* byte offset of member in structure*/\
  152.         ((int) &(((structure *) 0) -> member))
  153.  
  154. #define MEMBER_SIZE(structure, member)    /* size of a member of a structure */\
  155.         (sizeof (((structure *) 0) -> member))
  156.  
  157. #define NELEMENTS(array)        /* number of elements in an array */ \
  158.         (sizeof (array) / sizeof ((array) [0]))
  159.  
  160. #define FOREVER    for (;;)
  161.  
  162. #define max(x, y)    (((x) < (y)) ? (y) : (x))
  163. #define min(x, y)    (((x) < (y)) ? (x) : (y))
  164.  
  165.  
  166. /* storage class specifier definitions */
  167.  
  168. #define FAST    register
  169. #define IMPORT    extern
  170. #define LOCAL    static
  171.  
  172.  
  173. /* include typedefs - must come after CPU_FAMILY definitions above */
  174.  
  175. #include "vxTypes.h"
  176.  
  177. #endif    /* INCvxWorksh */
  178.